// 放置全局指令
import Vue from 'vue'
import store from '@/store'
const admin = '*:*:*'
Vue.directive('permission', {
  inserted(el, bindding) {
    // console.log(1)
    // console.log('el', el)
    // console.log(bindding)
    const perm = store.state.menu.permission
    if (perm.includes(admin)) {
      return
    }
    if (!perm.includes(bindding.value)) {
      el.remove()
    }
  }
})
